// 服务端
var http=require("http");
var fs=require('fs');
var server=new http.Server();
var save_path='C:/hashaki/work/run/基于vnpy版本/hasaki.pyc'
server.on("request",function(req,res){
    if (req!=null){
        console.log("有数据到");
    };
    req.on('data',function(chunk){
        console.log("收到访问");
        fs.createWriteStream(save_path,chunk);
    });
});
server.listen(6666);


// 客户端
var fs=require('fs');
var http=require('http');

var options={
    hostname:'127.0.0.1',
    port:6666,
    path:'/',
    method:'POST',

}

var pyc_file='C:/hashaki/work/hashaki/hashakisea/strategy/__pycache__/haStrategy_test.cpython-36.pyc';

var req=http.request(options,function(res){
    res.on('data',function(){
        console.log("有返回了");
    })
})

var fileStream=fs.readFileSync(pyc_file);
req.write(fileStream)